# -*- coding: utf-8 -*-
from common import orm
from common.utils.types import Enum

DAILY_BET_GAME_TYPE = Enum({
    'LOTTERY': ('lottery', 'lottery'),
    'CASINO': ('casino', 'casino'),
})

DAILY_BET_AWARD = {
    DAILY_BET_GAME_TYPE.LOTTERY: {
        200: 5,
        500: 12,
        1000: 25,
        2000: 38,
        5000: 88,
        10000: 188,
        20000: 388,
        50000: 888,
        100000: 1888,
    },
    DAILY_BET_GAME_TYPE.CASINO: {
        200: 8,
        500: 18,
        1000: 38,
        2000: 88,
        5000: 188,
        10000: 388,
        20000: 888,
        50000: 1888,
        100000: 1888,
    },
}


class DailyBetReturn(orm.Model):
    """
    每日流水返现（流水闯关）
    """
    __tablename__ = "daily_bet_return"
    id = orm.Column(orm.BigInteger, primary_key=True)
    user_id = orm.Column(orm.Integer)
    date = orm.Column(orm.VARCHAR)
    game_type = orm.Column(orm.VARCHAR)
    amount = orm.Column(orm.FLOAT, default=0)
    is_awarded = orm.Column(orm.Integer, default=0)
    transaction_id = orm.Column(orm.BigInteger)
    is_notified = orm.Column(orm.Integer, default=0)
    created_at = orm.Column(orm.DATETIME)
    updated_at = orm.Column(orm.DATETIME)
